function cube3D = draw_cube(width, depth, height, location)
s = 0.1;%sampling
xlbf_org = location;
xlbb_org = location + [0 depth 0];
xltf_org = location + [0 0 height];
xltb_org = location + [0 depth height];
w = width/s;
xlbf = zeros(w,3);
xlbb = xlbf;
xltf = xlbf;
xltb = xlbf;
for i = 1:w
    xlbf(i,:) = xlbf_org + i*s*[1 0 0];    
    xlbb(i,:) = xlbb_org + i*s*[1 0 0];
    xltf(i,:) = xltf_org + i*s*[1 0 0];
    xltb(i,:) = xltb_org + i*s*[1 0 0];    
end
cube3D = [xlbf;xlbb;xltf;xltb];

ylbf_org = location;
ylbb_org = location + [width    0   0];
yltf_org = location + [0        0   height];
yltb_org = location + [width    0   height];
d = depth/s;
ylbf = zeros(d,3);
ylbb = ylbf;
yltf = ylbf;
yltb = ylbf;
for i = 1:d
    ylbf(i,:) = ylbf_org + i*s*[0 1 0];    
    ylbb(i,:) = ylbb_org + i*s*[0 1 0];
    yltf(i,:) = yltf_org + i*s*[0 1 0];
    yltb(i,:) = yltb_org + i*s*[0 1 0];    
end
cube3D = [cube3D;ylbf;ylbb;yltf;yltb];

zlbf_org = location;
zlbb_org = location + [0        depth   0];
zltf_org = location + [width    0       0];
zltb_org = location + [width    depth   0];
h = depth/s;
zlbf = zeros(d,3);
zlbb = zlbf;
zltf = zlbf;
zltb = zlbf;
for i = 1:h
    zlbf(i,:) = zlbf_org + i*s*[0 0 1];    
    zlbb(i,:) = zlbb_org + i*s*[0 0 1];
    zltf(i,:) = zltf_org + i*s*[0 0 1];
    zltb(i,:) = zltb_org + i*s*[0 0 1];    
end
cube3D = [cube3D;zlbf;zlbb;zltf;zltb];
end